#include <stdio.h>
#define N 88
long long f[N];
void fib()
{
    int i;
    f[0] = 1;
    f[1] = 2;
    for(i = 2;i< N;i++) f[i] = f[i-1]+f[i-2];
}
int main()
{
    long long k;
    int i, cnt; 
    fib();
    while(scanf("%I64d",&k)!=EOF)
    {        
        for(i = 0;i < N;i++)
        {
            if(f[i] > k)
            {
                cnt = i-1;
                break;
            } 
        }
        printf("%d\n",cnt);
    } 
} 
